Skip to content

ci: publish CI images to internal registry first#4002

Draft
realFlowControl wants to merge 8 commits into
masterfrom
florian/ci-images
Draft

ci: publish CI images to internal registry first#4002
realFlowControl wants to merge 8 commits into
masterfrom
florian/ci-images

Conversation

@realFlowControl

@realFlowControl realFlowControl commented Jun 22, 2026

Copy link
Copy Markdown
Member

Description

When building CI docker images, this PR changes the process to:

  • publish images to registry.ddbuild.io (Datadog internal container registry)
  • use those images directly for GitLab Jobs (they are authenticated anyway)
  • use the public-images downstream job to magically sync those images to Docker Hub for usage with GitHub CI and external contributors

Wins

  • no logging in to Docker Hub to get a PAT
  • no manually starting a GitLab CI run anymore (with that PAT)
  • no manual syncing public Docker Hub images to our internal registry (well running a script and making a PR and finding someone to approve)

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

@datadog-official

datadog-official Bot commented Jun 22, 2026

Copy link
Copy Markdown

Pipelines  Tests

Fix all issues with BitsAI

⚠️ Warnings

🚦 2 Pipeline jobs failed

Profiling ASAN/UBSAN Tests | PHP 8.3 nts-asan (arm-8core-linux)   View in Datadog   GitHub Actions

Profiling ASAN/UBSAN Tests | PHP 8.5 nts UBSAN (ubuntu-8-core-latest)   View in Datadog   GitHub Actions

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 0464d2c | Docs | Datadog PR Page | Give us feedback!

@realFlowControl realFlowControl changed the title Publish CI images to internal ddbuild registry ci: publish CI images to internal registry first Jun 22, 2026
- Update .gitlab/ci-images.yml to change the default CI_REGISTRY to registry.ddbuild.io and target the ddbuild registry path registry.ddbuild.io/ci/dd-trace-php/dd-trace-ci.
- Make docker logins dynamic to support local builds, Docker Hub logins, and AWS ECR logins depending on the target registry server.
- Bypass runner credential helper issues in Linux container environments by resetting ~/.docker/config.json.
- Make registry and base image names fully configurable in docker-compose.yml and Dockerfiles, allowing parent base images to be dynamically resolved from ddbuild during child compilation steps.
- Update all GitLab CI generator scripts (.gitlab/generate-*.php) to use internal CI images from registry.ddbuild.io/ci/dd-trace-php/dd-trace-ci instead of pulling from Docker Hub via the mirror path.
- This ensures test jobs use the newly compiled images directly from our project's ECR registry namespace.
- Add a new 'ci-publish' stage to .gitlab-ci.yml.
- Implement 4 parallel matrix trigger jobs in .gitlab/ci-images.yml (Publish CentOS, Publish Bookworm, Publish Alpine, and Publish Windows) to run automatically after their respective build jobs succeed.
- Each trigger calls the DataDog/public-images pipeline, passing the corresponding internal ddbuild ECR image as source and targeting public Docker Hub as destination under the exact same tag.
- Update all occurrences of bookworm-8 and shared-ext-8 to bookworm-9 and shared-ext-9 globally across .gitlab CI test generators, .gitlab/ci-images.yml, and .github workflows.
- Update BOOKWORM_VERSION from 8 to 9 in tooling/bin/build-debug-artifact to ensure local debug builds pull and compile with the new version.
- Export MAKEFLAGS=-j at the top of build-extensions.sh.
- This forces all underlying make invocations triggered by pecl install (including the heavy single-threaded gRPC, MongoDB, and parallel builds) to compile in parallel, drastically reducing build times on multi-core runner environments.
- Remove obsolete CI_REGISTRY, CI_REGISTRY_USER, and CI_REGISTRY_TOKEN from .gitlab/ci-images.yml.
- Remove all complex, dynamic ECR/Docker Hub login shell blocks and AWS CLI installations from CentOS, Alpine, Bookworm, and Windows build jobs.
- Rely entirely on the runner's native, pre-configured credentials for registry.ddbuild.io, significantly simplifying the pipeline configuration.
- Clean up dockerfiles/ci/README.md to document the new automated, secure internal ECR build flow.
- Clarify that project collaborators no longer need to configure Personal Access Tokens (PATs) or credentials when building CI images.
- Document how to trigger the manual sync to the public Docker Hub registry via downstream triggers in the 'ci-publish' stage.
@realFlowControl realFlowControl force-pushed the florian/ci-images branch 8 times, most recently from 6d45d97 to 93e1c93 Compare June 23, 2026 15:06
GitLab cannot expand variables in needs:, so a single parallel manifest job
cannot depend on only its own version's two arch builds. Generate explicit
per-image jobs instead.

.gitlab/generate-ci-images.php reads the docker-compose.yml + .env files
(single source of truth for PHP versions and tags) and renders
.gitlab/ci-images.yml.tpl, emitting per Linux image:
  - <OS> build       : version x arch build matrix (compose build, no buildx
                       builder instance, then docker push the per-arch tag)
  - <OS> manifest:<v>: auto-triggers (on_success) once its two arch builds
                       finish; needs them by literal name
  - <OS> publish:<v> : manual, triggers DataDog/public-images (dockerhub only)

Static preamble + Windows jobs live in .gitlab/ci-images.static.yml (Windows
is single-arch, no manifest). The generator runs in generate-templates and is
triggered as a child pipeline via the new manual 'ci-images' job; the old
.gitlab/ci-images.yml local include is removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant